package com.leruan.aasimp.service.impl;

import java.util.List;

import com.leruan.aasimp.dao.CarInfoDao;
import com.leruan.aasimp.dao.CarMainInfoDao;
import com.leruan.aasimp.dao.CarPartsDao;
import com.leruan.aasimp.dao.CarPartsImageDao;
import com.leruan.aasimp.dao.CarPartsSendDao;
import com.leruan.aasimp.dao.CompanyInfoDao;
import com.leruan.aasimp.dao.MaintainDao;
import com.leruan.aasimp.dao.MaintainItemsDao;
import com.leruan.aasimp.dao.OddDao;
import com.leruan.aasimp.entity.CarCompanyInfo;
import com.leruan.aasimp.entity.CarInfo;
import com.leruan.aasimp.entity.CarMainInfo;
import com.leruan.aasimp.entity.CarMaintenanceItem;
import com.leruan.aasimp.entity.CarMaintenanceRecord;
import com.leruan.aasimp.entity.CarOdd;
import com.leruan.aasimp.entity.CarParts;
import com.leruan.aasimp.entity.CarPartsImage;
import com.leruan.aasimp.entity.CarPartsSend;
import com.leruan.aasimp.service.MaintenanceService;

public class MaintenanceServiceImpl implements MaintenanceService{
	
	private CompanyInfoDao companyInfoDao;
	private OddDao oddDao;
	private MaintainDao maintainDao;
	private MaintainItemsDao maintainItemsDao;
	private CarInfoDao carInfoDao;
	private CarPartsDao carPartsDao;
	private CarPartsImageDao carPartsImageDao; 
	private CarPartsSendDao carPartsSendDao;
	private CarMainInfoDao carMainInfoDao;

	public CarMainInfoDao getCarMainInfoDao() {
		return carMainInfoDao;
	}

	public void setCarMainInfoDao(CarMainInfoDao carMainInfoDao) {
		this.carMainInfoDao = carMainInfoDao;
	}

	public MaintainItemsDao getMaintainItemsDao() {
		return maintainItemsDao;
	}

	public void setMaintainItemsDao(MaintainItemsDao maintainItemsDao) {
		this.maintainItemsDao = maintainItemsDao;
	}

	public CarPartsImageDao getCarPartsImageDao() {
		return carPartsImageDao;
	}

	public void setCarPartsImageDao(CarPartsImageDao carPartsImageDao) {
		this.carPartsImageDao = carPartsImageDao;
	}

	public CarPartsDao getCarPartsDao() {
		return carPartsDao;
	}

	public void setCarPartsDao(CarPartsDao carPartsDao) {
		this.carPartsDao = carPartsDao;
	}

	public CarInfoDao getCarInfoDao() {
		return carInfoDao;
	}

	public void setCarInfoDao(CarInfoDao carInfoDao) {
		this.carInfoDao = carInfoDao;
	}

	public OddDao getOddDao() {
		return oddDao;
	}

	public void setOddDao(OddDao oddDao) {
		this.oddDao = oddDao;
	}

	public void addCompany(CarCompanyInfo companyInfo) {
		companyInfoDao.addCompany(companyInfo);		
	}

	public CarCompanyInfo getCompanyByID(String userid) {
		return companyInfoDao.getCompanyByID(userid);
	}

	public void updateCompany(CarCompanyInfo companyInfo) {
		companyInfoDao.updateCompany(companyInfo);		
	}

	public CompanyInfoDao getCompanyInfoDao() {
		return companyInfoDao;
	}

	public void setCompanyInfoDao(CompanyInfoDao companyInfoDao) {
		this.companyInfoDao = companyInfoDao;
	}

	public List<CarCompanyInfo> getCompanys() {
		return companyInfoDao.getCompanys();
	}

	public void addOdd(CarOdd odd) {
		oddDao.addOdd(odd);
	}

	public CarOdd getOddByOid(Long oddId) {
		return oddDao.getOddByOid(oddId);
	}

	public void updateOdd(CarOdd odd) {
		oddDao.updateOdd(odd);
	}

	public List<CarOdd> getOdd(String username) {
		return oddDao.getOdd(username);
	}

	public List<CarOdd> getOddByCompanyNm(String companyName) {
		return oddDao.getOddByCompanyNm(companyName);
	}

	public List<CarOdd> getPassOddByCompanyNm(String companyName) {
		return oddDao.getPassOddByCompanyNm(companyName);
	}

	public void addMaintain(CarMaintenanceRecord maintenanceRecord) {
		maintainDao.addMaintain(maintenanceRecord);
	}

	public CarMaintenanceRecord getMaintainByMID(Long maintainId) {
		return maintainDao.getMaintainByMID(maintainId);
	}

	public List<CarMaintenanceRecord> getMaintains() {
		return maintainDao.getMaintains();
	}

	public void updateMaintain(CarMaintenanceRecord maintenanceRecord) {
		maintainDao.updateMaintain(maintenanceRecord);
	}

	public MaintainDao getMaintainDao() {
		return maintainDao;
	}

	public void setMaintainDao(MaintainDao maintainDao) {
		this.maintainDao = maintainDao;
	}

	public List<CarMaintenanceRecord> getMaintainByUm(String handperson) {
		return maintainDao.getMaintainByUm(handperson);
	}

	public void saveMtInfo(CarInfo carInfo) {
		carInfoDao.saveMtInfo(carInfo);
	}

	public void addPart(CarParts carParts) {
		carPartsDao.addPart(carParts);
	}

	public void addPartsImage(CarPartsImage partsImage) {
		carPartsImageDao.addPartsImage(partsImage);
	}

	public List<CarParts> getAllParts() {
		return carPartsDao.getAllParts();
	}

	public void addMtItems(List<CarMaintenanceItem> items) {
		maintainItemsDao.addMtItems(items);
	}

	public void deleteItems(Long maintainId) {
		maintainItemsDao.deleteItems(maintainId);
	}

	public List<CarMaintenanceItem> getItemsById(Long maintainId) {
		return maintainItemsDao.getItemsById(maintainId);
	}

	public List<CarMaintenanceItem> getAllMtParts() {
		return maintainItemsDao.getAllMtParts();
	}

	public List<Long> getAllMaintainIds() {
		return maintainItemsDao.getAllMaintainIds();
	}

	public List<CarInfo> getAllMtInfo(int pageNo) {
		return carInfoDao.getAllMtInfo(pageNo);
	}

	public Long getMtCount() {
		return carInfoDao.getMtCount();
	}

	public List<CarInfo> getAllPtInfo(int pageNo) {
		return carInfoDao.getAllPtInfo(pageNo);
	}

	public CarPartsImage getImgByID(String title) {
		return carPartsImageDao.getImgByID(title);
	}

	public CarPartsSend getPtByID(String title) {
		return carPartsSendDao.getPtByID(title);
	}

	public CarPartsSendDao getCarPartsSendDao() {
		return carPartsSendDao;
	}

	public void setCarPartsSendDao(CarPartsSendDao carPartsSendDao) {
		this.carPartsSendDao = carPartsSendDao;
	}

	public void addPartSend(CarPartsSend partsSend) {
		carPartsSendDao.addPart(partsSend);
	}

	public Long getPtCount() {
		return carInfoDao.getPtCount();
	}

	public CarInfo getMtById(String id) {
		return carInfoDao.getMtById(id);
	}

	public List<CarMainInfo> getCarsInfoByIdd(String usercard) {
		return carMainInfoDao.getCarsInfoByIdd(usercard);
	}

	public List<CarMaintenanceRecord> getMaintainByVin(String vin) {
		return maintainDao.getMaintainByVin(vin);
	}

}
